package cn.gson.springboot.model.service;

import java.util.List; 

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.fastjson.JSONArray;

import cn.gson.springboot.model.dao.DrugsYkDao;
import cn.gson.springboot.model.dao.InventoryYkDAO;
import cn.gson.springboot.model.mapper.InventoryYkMapper;
import cn.gson.springboot.model.pojos.DrugsYk;
import cn.gson.springboot.model.pojos.InventoryYk;
import cn.gson.springboot.model.vo.InventoryYkVO;

@Service
@Transactional(rollbackFor=Exception.class)
public class InventoryYkService {
	@Autowired
	private InventoryYkMapper im;
	@Autowired
	private DrugsYkDao dd;  
	@Autowired
	private InventoryYkDAO ivd;//库存
	
	//查询所有
	public JSONArray findkucun(String drug_name) {
		if(drug_name!=null) {
			if(drug_name.trim().equals("")) {
				drug_name=null;
			}
		}
		return im.findkucun(drug_name);
	}
	
	//库存新增
	public JSONArray findxinzeng(Integer inventory_yk_id,Integer aa) {
		return im.findxinzeng(inventory_yk_id, aa);
	}
	
	//库存减少
	public JSONArray findjianshao(Integer inventory_yk_id,Integer bb) {
		return im.findjianshao(inventory_yk_id, bb);
	}
	
	//采购入库库存新增
	public JSONArray kucunxinzeng(Integer drug_id) {
		return im.kucunxinzeng(drug_id);
	}
	
	
}
